home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4484 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: erich.triumf.ca!bennett
  2. From: bennett@erich.triumf.ca (P.Bennett)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: why doesn't atof work properly ?
  5. Date: 4 Feb 1996 22:23 PST
  6. Organization: TRIUMF: Tri-University Meson Facility
  7. Distribution: world
  8. Message-ID: <4FEB199622232190@erich.triumf.ca>
  9. References: <4f0ivh$3g7e@yuma.ACNS.ColoState.EDU> <3FEB199617132831@erich.triumf.ca> <9602041608.AA19516@dxmint.cern.ch> <823481406snz@genesis.demon.co.uk>
  10. NNTP-Posting-Host: ftp.triumf.ca
  11. News-Software: VAX/VMS VNEWS 1.50    
  12.  
  13. In article <823481406snz@genesis.demon.co.uk>, fred@genesis.demon.co.uk writes...
  14. >In article <9602041608.AA19516@dxmint.cern.ch>
  15. >           danpop@mail.cern.ch "Dan Pop" writes:
  16. >>bennett@erich.triumf.ca (P.Bennett) writes:
  17. >>
  18. >>>You need to #include either (or both, if you wish) math.h or stdlib.h to get
  19. >>>the prototype for atof().
  20. >>
  21. >>Actually, I couldn't find any requirement that <math.h> contains a
  22. >>declaration for atof.
  23. >Right - atof isn't defined in <math.h> nor is it reserved so an ANSI
  24. >implementation is prohibited from defining it in <math.h>
  25.  
  26. A little Borland gotcha, I guess - My  Borland C++ V. 2 manual indicates that
  27. both math.h and stdlib.h have the prototype.
  28.  
  29. Looking at math.h, I find that atof() is there, but inside a #if !__STDC__
  30. block, so, if the compiler is set for Standard C, it won't be seen...
  31.  
  32. Peter Bennett VE7CEI                | Vessels shall be deemed to be in sight
  33. Internet: bennett@triumf.ca         | of one another only when one can be
  34. Packet: ve7cei@ve7kit.#vanc.bc.ca   | observed visually from the other
  35. TRIUMF, Vancouver, B.C., Canada     |                          ColRegs 3(k)
  36. GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.